<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui"
	xmlns:ui="http://java.sun.com/jsf/facelets">
<h:body>
	<p:dialog modal="true" widgetVar="consultaAta"
		header="Consulta Ata Eletrônica" height="520" width="1100">
		<h:form id="formConsAta">
			<h:panelGrid style="font-size:13px;" columns="6">
				<h:outputLabel value="#{message.solicita_filial}"
					styleClass="LabelFont" style="margin-left:30px;" />
				<p:selectOneMenu value="#{ataEletronicaTela.filialAtaFiltro}"
					effect="fade" style="font-size: 13px;">
					<f:selectItem itemLabel="" itemValue="" />
					<f:selectItem itemLabel="Administrativo" itemValue="15" />
					<f:selectItem itemLabel="Capivari" itemValue="02" />
					<f:selectItem itemLabel="Criciúma" itemValue="06" />
					<f:selectItem itemLabel="Içara" itemValue="04" />
					<f:selectItem itemLabel="Içara II" itemValue="16" />
					<f:selectItem itemLabel="Matriz" itemValue="01" />
				</p:selectOneMenu>

				<h:outputLabel value="#{message.label_diretoria}"
					styleClass="LabelFont" style="margin-left:30px;" />
				<p:selectOneMenu value="#{ataEletronicaTela.codigoDiretoriaFiltro}"
					effect="fade" style="font-size: 13px; width: 180px;">
					<f:selectItem itemLabel="" itemValue="" />
					<f:selectItems value="#{ataEletronicaTela.listaDiretorias}"
						var="dire"
						itemLabel="#{dire.codigoDiretoria} - #{dire.descricaoDiretoria}"
						itemValue="#{dire.codigoDiretoria}" style="font-size: 13px;" />
				</p:selectOneMenu>

				<h:outputLabel value="#{message.label_data} evento de:"
					styleClass="LabelFont" style="margin-left:30px;" />
				<p:calendar locale="pt" size="5" pattern="dd/MM/yy"
					value="#{ataEletronicaTela.dataAtaDeFiltro}" />

				<h:outputLabel value="#{message.label_data} evento até:"
					styleClass="LabelFont" style="margin-left:30px;" />
				<p:calendar locale="pt" size="5" pattern="dd/MM/yy"
					value="#{ataEletronicaTela.dataAtaAteFiltro}" />

				<h:outputLabel value="Nº Ata" styleClass="LabelFont"
					style="margin-left:30px;" />
				<p:inputText value="#{ataEletronicaTela.numeroAtaFiltro}" />

				<h:outputLabel value="#{message.label_assunto}"
					styleClass="LabelFont" style="margin-left:30px;" />
				<p:inputText value="#{ataEletronicaTela.assuntoFiltro}" />
			</h:panelGrid>

			<div>
				<p:commandButton icon="ui-icon-search" value="Filtrar"
					actionListener="#{ataEletronicaTela.filtrarAtas}"
					update=":formTabelaAtas,:growl" />
			</div>
		</h:form>
		<div align="left" style="padding-left: 3px; padding-top: 5px;">
			<h:form id="formTabelaAtas">
				<p:dataTable var="ata" style="width:1050px;font-size: 12px;"
					emptyMessage="#{message.msg_semvalores}" rows="8"
					paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
					rowsPerPageTemplate="8,15,20,30,50" paginator="true"
					value="#{ataEletronicaTela.listaAtasBusca}">

					<p:column headerText="ID" sortBy="#{ata.idAta}">
						<h:outputText value="#{ata.idAta}" />
					</p:column>
					<p:column headerText="#{message.solicita_filial}"
						sortBy="#{ata.filialAta.descricao}">
						<h:outputText value="#{ata.filialAta.descricao}" />
					</p:column>
					<p:column headerText="#{message.label_origem}">
						<h:outputText value="#{ata.origemAta}" />
					</p:column>
					<p:column headerText="#{message.label_diretoria}">
						<h:outputText value="#{ata.diretoriaAta.descricaoDiretoria}" />
					</p:column>
					<p:column headerText="#{message.label_data}"
						sortBy="#{ata.dataAta}">
						<h:outputText value="#{ata.dataAta}">
							<f:convertDateTime pattern="dd/MM/yy" locale="pt" />
						</h:outputText>
					</p:column>
					<p:column headerText="HI">
						<h:outputText value="#{ata.horaInicioAta}"
							title="#{message.label_hora} Início">
							<f:convertDateTime pattern="HH:mm" locale="pt"
								timeZone="GMT-03:00" />
						</h:outputText>
					</p:column>
					<p:column headerText="HF">
						<h:outputText value="#{ata.horaFimAta}"
							title="#{message.label_hora} #{message.label_fim}">
							<f:convertDateTime pattern="HH:mm" locale="pt"
								timeZone="GMT-03:00" />
						</h:outputText>
					</p:column>
					<p:column headerText="#{message.produto_armazem}">
						<h:outputText value="#{ata.localAta}" />
					</p:column>
					<p:column headerText="#{message.label_assunto}">
						<h:outputText value="#{ata.assuntoAta}" />
					</p:column>
					<p:column headerText="#{message.label_responsavel}"
						sortBy="#{ata.responsavel.nome}">
						<h:outputText value="#{ata.nomeResponsaveis}" />
					</p:column>
					<p:column style="width: 80px;">
						<p:commandButton icon="ui-icon-print" title="Imprimir"
							styleClass="ButtonPesq"
							actionListener="#{ataEletronicaTela.imprime(ata)}"
							oncomplete="mostraAta(#{usuario.codigo})" />

						<p:commandButton icon="ui-icon-arrowthickstop-1-n"
							title="Anexar Lista de Presença" styleClass="ButtonPesq"
							style="margin-left: 10px;" onclick="dlgAnexaLista.show()">
							<f:setPropertyActionListener
								target="#{ataEletronicaTela.ataEletronica}" value="#{ata}" />
						</p:commandButton>

						<p:commandButton styleClass="ButtonPesq"
							title="Download Lista de Presença"
							icon="ui-icon-arrowthickstop-1-s" ajax="false"
							rendered="#{ata.listaDePresencaReuniao != null ? true : false}"
							style="margin-left: 10px;">
							<p:fileDownload value="#{ataEletronicaTela.downloadArquivo(ata)}" />
						</p:commandButton>
					</p:column>

				</p:dataTable>
			</h:form>
		</div>
	</p:dialog>


	<p:dialog widgetVar="dlgAnexaLista" modal="true"
		header="Anexo Lista de Presença">
		<h:form>
			<p:fileUpload style="font-size: 13px;"
				fileUploadListener="#{ataEletronicaTela.uploadArquivo}"
				mode="advanced" sizeLimit="1500000"
				allowTypes="/(\.|\/)(xlsx|rar|zip|xls|pdf)$/"
				label="#{message.botao_escolher}"
				uploadLabel="#{message.botao_carregar}"
				cancelLabel="#{message.botao_cancelar}" showButtons="false"
				auto="true" invalidSizeMessage="#{message.msg_tamanho_arquivo}"
				invalidFileMessage="#{message.msg_tipo_arquivo}"
				update=":messages,:formTabelaAtas" oncomplete="dlgAnexaLista.hide()" />
		</h:form>
	</p:dialog>

</h:body>
</html>